package com.bristua.barcode.order.controller;

import com.bristua.barcode.common.bean.Result;
import com.bristua.barcode.common.util.HandleResultUtil;
import com.bristua.barcode.common.util.JsonUtil;
import com.bristua.barcode.customer.model.condition.QueryOrderParams;
import com.bristua.barcode.customer.model.condition.SendOrderParams;
import com.bristua.barcode.order.biz.QueryOrderBiz;
import com.bristua.barcode.order.biz.SendOrderBiz;
import com.bristua.barcode.order.enums.OrderCode;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Administrator on 2019/8/9 0009.
 */
@RestController
public class QueryOrderController {


    private static final Logger logger = LoggerFactory.getLogger(QueryOrderController.class);

    @Autowired
    private QueryOrderBiz queryOrderBiz;

    @PostMapping(value = "/customer/query/order")
    public Result sendOrder(@RequestBody QueryOrderParams queryOrderParams){
        logger.info("订单查询参数:"+ JsonUtil.toJson(queryOrderParams));
        return HandleResultUtil.querySuccessResult(queryOrderBiz.queryOrder(queryOrderParams));
    }
}
